import pymongo

myclient = pymongo.MongoClient("mongodb://localhost:7891/")
db = myclient.admin
# 认证
db.authenticate('adminkpmg', 'kpmg123')
mydb = myclient["spider"]

